]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
polkitAgent: Disconnect from user signals when closing dialogue
authorPhilip Withnall <withnall@endlessm.com>
Fri, 18 Jan 2019 13:22:33 +0000 (13:22 +0000)
committerFlorian Müllner <florian.muellner@gmail.com>
Thu, 24 Jan 2019 14:48:48 +0000 (14:48 +0000)
Otherwise the user object could outlive the dialogue, emit a subsequent
signal, and the callback from that signal could reference finalised
objects/widgets from the dialogue. The likely mechanism for the user
outliving the dialogue is caching of user objects within
libaccountsservice.

This can be triggered by running `pkexec true` from a gnome-terminal
window, then calling `pkill pkexec` from another terminal (on a
different VT or via SSH). This causes the dialogue to be cancelled by
polkitd.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/357

js/ui/components/polkitAgent.js

index 7f38e122e3e1f75660dd241a5616fcb7a022b990..dee5f38b3604f1ccc0bfbf30a8f0f44e80ead08b 100644 (file)
@@ -332,6 +332,12 @@ var AuthenticationDialog = new Lang.Class({
             Main.sessionMode.disconnect(this._sessionUpdatedId);
         this._sessionUpdatedId = 0;
 
+        if (this._user) {
+            this._user.disconnect(this._userLoadedId);
+            this._user.disconnect(this._userChangedId);
+            this._user = null;
+        }
+
         this._destroySession();
     },
 });